import request from '@/utils/request'

// 查询库存列表
export function listInventory(query) {
  return request({
    url: '/aid/inventory/list',
    method: 'get',
    params: query
  })
}

// 查询库存详细
export function getInventory(inventoryId) {
  return request({
    url: '/aid/inventory/' + inventoryId,
    method: 'get'
  })
}

// 新增库存
export function addInventory(data) {
  return request({
    url: '/aid/inventory',
    method: 'post',
    data: data
  })
}

// 修改库存
export function updateInventory(data) {
  return request({
    url: '/aid/inventory',
    method: 'put',
    data: data
  })
}

// 删除库存
export function delInventory(inventoryId) {
  return request({
    url: '/aid/inventory/' + inventoryId,
    method: 'delete'
  })
}

// 导出库存
export function exportInventory(query) {
  return request({
    url: '/aid/inventory/export',
    method: 'get',
    params: query
  })
}

// 根据仓库ID查询库存
export function getInventoryByWarehouse(warehouseId) {
  return request({
    url: '/aid/inventory/warehouse/' + warehouseId,
    method: 'get'
  })
}

// 根据物资名称查询库存
export function getInventoryByMaterial(materialName) {
  return request({
    url: '/aid/inventory/material',
    method: 'get',
    params: { materialName }
  })
} 